package com.zjj.learn.designmodel.pattern.command;

import java.util.Set;

/**
 * *** @author zjj_admin
 * *** 2022/4/17 22:07
 */
public class OrderCommand implements Command{


    private SeniorChef seniorChef;
    private Order order;

    public OrderCommand(SeniorChef seniorChef, Order order) {
        this.seniorChef = seniorChef;
        this.order = order;
    }

    @Override
    public void execute() {

        System.out.println(order.getDiningTable()+"号桌订单...");
        Set<String> keys = order.getFoodDic().keySet();
        for (String key : keys) {
            seniorChef.makeFood(order.getFoodDic().get(key),key);
        }

        System.out.println(order.getDiningTable() +"号桌的菜做好了");

    }
}
